using System;

using NUnit.Framework;

namespace Icodeon.Util
{
    [TestFixture]
    public class ConsoleUtilsTest
    {
        [TestFixtureSetUp]
        public void Init()
        {
        }

        [TestFixtureTearDown]
        public void Dispose()
        {
        }

        [Test]
        public void TestCommandLine()
        {
            //s2cc /in:scorm /xsl:scorm2cc.xsl /out:cc /log:+ 
            string[] args = { "/in:scorm", "/xsl:scorm2cc.xsl", "/out:cc", "/log:+"};
            ConsoleUtils consoleUtils = new ConsoleUtils(args);

            string param = "in";
            string expected = "scorm";
            Assert.AreEqual(expected, consoleUtils[param]);

            param = "xsl";
            expected = "scorm2cc.xsl";
            Assert.AreEqual(expected, consoleUtils[param]);

            param = "out";
            expected = "cc";
            Assert.AreEqual(expected, consoleUtils[param]);

            param = "log";
            expected = "+";
            Assert.AreEqual(expected, consoleUtils[param]);

            //s2cc /in:c:/documents/scorm /xsl:c/files/scorm2cc.xsl /out:c:/documents/cc /log:-
            string[] args2 = {"/in:c:/documents/scorm", "/xsl:c/files/scorm2cc.xsl", "/out:c:/documents/cc"};
            consoleUtils = new ConsoleUtils(args2);

            param = "in";
            expected = "c:/documents/scorm";
            Assert.AreEqual(expected, consoleUtils[param]);

            param = "xsl";
            expected = "c/files/scorm2cc.xsl";
            Assert.AreEqual(expected, consoleUtils[param]);

        }
    }
}
